/********************************************************************
*  sample.cu
*  This is a example of the CUDA program.
*********************************************************************/

#include <vector>
#include <iostream>

#include "GpuOperation.h"

using namespace std;


int main(int argc, char* argv[])
{
	int N = 10;

	/// initialize array on host
	std::vector<float> a_h(N, 0);
	for(int i = 0; i<a_h.size(); i++)
		a_h[i] = float(i);

	///a_h -> a_d 
	CH::GlobalMemory<float> a_d(a_h);
	bindTexture( a_d );
	
	a_d.dump_to_screen();

	CH::GlobalMemory<float> r_d(a_h.size()); ///result
	
	/// run kernel
	launchKernel( r_d );


	///dump result
	r_d.dump_to_screen();

	return 0;
}
